@using Xunit;
@inherits TestContext
@code
{
    public DataGridColumnsPropertyTestsRazor()
    {
        JSInterop.Mode = JSRuntimeMode.Loose;
        Services.AddSingleton(LibraryConfiguration.ForUnitTests);

        // Register Service
        var keycodeService = new KeyCodeService();
        Services.AddScoped<IKeyCodeService>(factory => keycodeService);
    }

    private record TestItem(int Id, string Name);

    private readonly IQueryable<TestItem> TestData = new[]
    {
        new TestItem(1, "First Item"),
        new TestItem(2, "Second Item"),
    }.AsQueryable();

    [Fact]
    public void DataGrid_Properties_AccessibilityTest()
    {
        // Arrange & Act
        var cut = Render(
            @<FluentDataGrid Items="@TestData" TGridItem="TestItem">
                <PropertyColumn Property="@(item => item.Id)" Title="ID" />
                <PropertyColumn Property="@(item => item.Name)" Title="Name" />
            </FluentDataGrid>
        );

        // Assert that grid was rendered successfully
        Assert.NotNull(cut);
        
        // The fact that this test compiles and renders successfully
        // validates that our public properties are correctly exposed
        Assert.True(true, "DataGrid rendered successfully with public Column properties accessible");
    }
}